
import axios from 'axios';

/**
 * 维修评价
 */
export class NoticeService {
    // 分页查询列表
    static findNotices (queryParams) {
        return axios({
            url: '/repair/repairManagement/Notice/findNotices',
            method: 'POST',
            data: queryParams
        });
    }

    //根据ID查询指定的维修评价
    static findNotice (noticeId) {
        const query = {
            noticeId
        }
        return axios({
            url: '/repair/repairManagement/Notice/findNotice',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的维修评价(包含外键名称)
    static findNoticeForView (noticeId) {
        const query = {
            noticeId
        }
        return axios({
            url: '/repair/repairManagement/Notice/findNoticeForView',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的维修评价(包含外键名称)
    static findNoticeForEdit (noticeId) {
        const query = {
            noticeId
        }
        return axios({
            url: '/repair/repairManagement/Notice/findNoticeForEdit',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的维修评价(只提取ID 和 Name)
    static findNoticesWithIdNameById (noticeId) {
        const query = {
            noticeId
        }
        return axios({
            url: '/repair/repairManagement/Notice/findNoticesWithIdNameById',
            method: 'POST',
            params: query,
        });
    }

    //根据名称查询维修评价集合(只提取ID 和 Name)
    static findNoticesWithIdNameByName (noticeName) {
        const query = {
            noticeName
        }
        return axios({
            url: '/repair/repairManagement/Notice/findNoticesWithIdNameByName',
            method: 'POST',
            params: query,
        });
    }

    //新增保存维修评价
    static saveNotice (notice) {
        const query = {}
        return axios({
            url: '/repair/repairManagement/Notice/saveNotice',
            method: 'POST',
            params: query,
            data: notice
        });
    }

    //修改保存维修评价
    static updateNotice (notice) {
        const query = {}
        return axios({
            url: '/repair/repairManagement/Notice/updateNotice',
            method: 'POST',
            params: query,
            data: notice
        });
    }

    //根据ID查询指定的维修评价(只提取ID 和 Name)
    static deleteNotice (noticeId) {
        const query = {
            noticeId
        }
        return axios({
            url: '/repair/repairManagement/Notice/deleteNotice',
            method: 'POST',
            params: query,
        });
    }

  static push(noticeId) {
    const query = {
      noticeId
    }
    return axios({
      url: '/repair/repairManagement/Notice/pushNotice',
      method: 'POST',
      params: query,
    });
  }

  static findReadNoticeUser(noticeId) {
    const query = {
      noticeId
    }
    return axios({
      url: '/repair/repairManagement/Notice/findReadNoticeUser',
      method: 'POST',
      params: query,
    });
  }

  static findNotReadNoticeUser(noticeId) {
    const query = {
      noticeId
    }
    return axios({
      url: '/repair/repairManagement/Notice/findNotReadNoticeUser',
      method: 'POST',
      params: query,
    });
  }
}
